package com.china.milkywayeye.rasberryPi.service.impl;

import com.china.milkywayeye.rasberryPi.mapper.UserMapper;
import com.china.milkywayeye.rasberryPi.pojo.User;
import com.china.milkywayeye.rasberryPi.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> getUsers() {
        return userMapper.getUsers();
    }

    @Override
    public Boolean login(User user) {
        User user1 = userMapper.findUser(user.getAccount(), user.getPassword());
        if (user1 != null) {
            return true;
        } else {
            return false;
        }
    }
}
